var goUrl = "chargeListByJson.wss";
var goBack = "chargeInit.wss";
jQuery(document).ready(function() {
    var btSelect = jQuery("#btSelect");
    $j('#tabs').tabs();
    jQuery("#tb_list").jqGrid({   	
        url:goUrl, 
        datatype: "json",
        mtype: 'POST', 
        height: 'auto',
        colNames: ['订单号','充值金额','订单状态','充值卡号','充值时间',''],
        colModel: [ 
        { name: 'id', width: 190, align: "center", sortable: false, search: false },
        { name: 'money', width: 80, align: "center", sortable: false, search: false },
        { name: 'orderstatusstr',width: 60,align: "center", sortable: false},
    	{ name: 'cardno', width: 210, sortable: false, search: false },
    	{ name: 'createtime', width: 200, sortable: false, search: false },
    	{ name: 'createdate',index:'createdate', width:1, editable:true }],
        pager: "div_page", 
        rowNum: 20, 
        rowList: [20, 50, 100],   
        height: 460, 
        viewrecords: true,
        footerrow: true,
        sortname: 'createdate',
        sortorder: "desc",
        jsonReader:{
        repeatitems : false
        },
        grouping:true,   
        groupingView : {
   			groupField : ['createdate'],
   			groupColumnShow : [false],
   			groupDataSorted : [true]
   		} 
    });
    jQuery("#tb_list").jqGrid('navGrid', 'div_page', {edit: false, add: false, del: false,search: false   }, {}, {}, {}, { closeOnEscape: true });  
});
function getJQGridByPage() {
    return goUrl+"?pageNo="+ jQuery("#pageNo").val();
}
function getJQGridByDate() {
    return goUrl+"?startdate=" + jQuery("#tb_dates").val() + "&enddate=" + jQuery("#tb_datee").val();
}
function btSelectClick() {   
    jQuery("#tb_list").jqGrid("setGridParam", { url: getJQGridByDate(), page: 1 }).trigger("reloadGrid");
}
function gotoCharge()
{
   window.location.href=goBack; 
}
